﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace DFGK_WMS.Context.Migrations
{
    public partial class DatabaseUpdate : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<bool>(
                name: "IsSeeOnlySelfData",
                table: "TUsers",
                type: "bit",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "CreateUserId",
                table: "TStocktakingPlans",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "CreateUserName",
                table: "TStocktakingPlans",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "ParentPalletBarcode",
                table: "TStackingStorages",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<bool>(
                name: "IsOnceOut",
                table: "TShippingOrderDetails",
                type: "bit",
                nullable: true);

            migrationBuilder.AddColumn<Guid>(
                name: "OnceOutGroupGuid",
                table: "TShippingOrderDetails",
                type: "uniqueidentifier",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "ProduceFactory",
                table: "TShippingOrderDetails",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "SupplierId",
                table: "TShippingOrderDetails",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "SupplierName",
                table: "TShippingOrderDetails",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "ParentPalletBarcode",
                table: "TShippingLockCells",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "Priority",
                table: "TScheduledTasks",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "BatchNoExplain",
                table: "TReceivingOrderDetails",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "Price",
                table: "TReceivingOrderDetails",
                type: "decimal(18,2)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "ReceivingBillDetailId",
                table: "TReceivingOrderDetails",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "ReceivingBillId",
                table: "TReceivingOrderDetails",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "TotalPrice",
                table: "TReceivingOrderDetails",
                type: "decimal(18,2)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "CreateUserId",
                table: "TReceivingBills",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "CreateUserName",
                table: "TReceivingBills",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "TotalPrice",
                table: "TReceivingBills",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AddColumn<string>(
                name: "BatchNoExplain",
                table: "TReceivingBillDetails",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<DateTime>(
                name: "ExpireDate",
                table: "TReceivingBillDetails",
                type: "datetime2",
                nullable: true);

            migrationBuilder.AddColumn<DateTime>(
                name: "OutFactoryDate",
                table: "TReceivingBillDetails",
                type: "datetime2",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "Price",
                table: "TReceivingBillDetails",
                type: "decimal(18,2)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "ProduceFactory",
                table: "TReceivingBillDetails",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "TotalPrice",
                table: "TReceivingBillDetails",
                type: "decimal(18,2)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "ParentPalletBarcode",
                table: "TPutawayOrders",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "WarehouseId",
                table: "TPickingStationData",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<int>(
                name: "CreateUserId",
                table: "TPackageDetails",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<string>(
                name: "CreateUserName",
                table: "TPackageDetails",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "ExpirationMonth",
                table: "TMaterials",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<bool>(
                name: "IsDismantle",
                table: "TMaterials",
                type: "bit",
                nullable: true);

            migrationBuilder.AddColumn<bool>(
                name: "IsNeedCharging",
                table: "TMaterials",
                type: "bit",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "MaterialCategoryName",
                table: "TMaterials",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "Code",
                table: "TMaterialCategories",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "DisplayOrder",
                table: "TMaterialCategories",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "ParentId",
                table: "TMaterialCategories",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "Price",
                table: "TInventoryDetails",
                type: "decimal(18,2)",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "TotalPrice",
                table: "TInventoryDetails",
                type: "decimal(18,2)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "BatchNoExplain",
                table: "TInventories",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "CreateUserId",
                table: "TInventories",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "CreateUserName",
                table: "TInventories",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "MaterialCategoryId",
                table: "TInventories",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "MaterialCategoryName",
                table: "TInventories",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "ParentPalletBarcode",
                table: "TInventories",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "Price",
                table: "TInventories",
                type: "decimal(18,2)",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "TotalPrice",
                table: "TInventories",
                type: "decimal(18,2)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "CreateUserId",
                table: "TInterfaceLogs",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "CreateUserName",
                table: "TInterfaceLogs",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "CreateUserId",
                table: "TInstructs",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "CreateUserName",
                table: "TInstructs",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "LogicalCellAddr",
                table: "TInstructs",
                type: "nvarchar(max)",
                nullable: true);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "IsSeeOnlySelfData",
                table: "TUsers");

            migrationBuilder.DropColumn(
                name: "CreateUserId",
                table: "TStocktakingPlans");

            migrationBuilder.DropColumn(
                name: "CreateUserName",
                table: "TStocktakingPlans");

            migrationBuilder.DropColumn(
                name: "ParentPalletBarcode",
                table: "TStackingStorages");

            migrationBuilder.DropColumn(
                name: "IsOnceOut",
                table: "TShippingOrderDetails");

            migrationBuilder.DropColumn(
                name: "OnceOutGroupGuid",
                table: "TShippingOrderDetails");

            migrationBuilder.DropColumn(
                name: "ProduceFactory",
                table: "TShippingOrderDetails");

            migrationBuilder.DropColumn(
                name: "SupplierId",
                table: "TShippingOrderDetails");

            migrationBuilder.DropColumn(
                name: "SupplierName",
                table: "TShippingOrderDetails");

            migrationBuilder.DropColumn(
                name: "ParentPalletBarcode",
                table: "TShippingLockCells");

            migrationBuilder.DropColumn(
                name: "Priority",
                table: "TScheduledTasks");

            migrationBuilder.DropColumn(
                name: "BatchNoExplain",
                table: "TReceivingOrderDetails");

            migrationBuilder.DropColumn(
                name: "Price",
                table: "TReceivingOrderDetails");

            migrationBuilder.DropColumn(
                name: "ReceivingBillDetailId",
                table: "TReceivingOrderDetails");

            migrationBuilder.DropColumn(
                name: "ReceivingBillId",
                table: "TReceivingOrderDetails");

            migrationBuilder.DropColumn(
                name: "TotalPrice",
                table: "TReceivingOrderDetails");

            migrationBuilder.DropColumn(
                name: "CreateUserId",
                table: "TReceivingBills");

            migrationBuilder.DropColumn(
                name: "CreateUserName",
                table: "TReceivingBills");

            migrationBuilder.DropColumn(
                name: "TotalPrice",
                table: "TReceivingBills");

            migrationBuilder.DropColumn(
                name: "BatchNoExplain",
                table: "TReceivingBillDetails");

            migrationBuilder.DropColumn(
                name: "ExpireDate",
                table: "TReceivingBillDetails");

            migrationBuilder.DropColumn(
                name: "OutFactoryDate",
                table: "TReceivingBillDetails");

            migrationBuilder.DropColumn(
                name: "Price",
                table: "TReceivingBillDetails");

            migrationBuilder.DropColumn(
                name: "ProduceFactory",
                table: "TReceivingBillDetails");

            migrationBuilder.DropColumn(
                name: "TotalPrice",
                table: "TReceivingBillDetails");

            migrationBuilder.DropColumn(
                name: "ParentPalletBarcode",
                table: "TPutawayOrders");

            migrationBuilder.DropColumn(
                name: "WarehouseId",
                table: "TPickingStationData");

            migrationBuilder.DropColumn(
                name: "CreateUserId",
                table: "TPackageDetails");

            migrationBuilder.DropColumn(
                name: "CreateUserName",
                table: "TPackageDetails");

            migrationBuilder.DropColumn(
                name: "ExpirationMonth",
                table: "TMaterials");

            migrationBuilder.DropColumn(
                name: "IsDismantle",
                table: "TMaterials");

            migrationBuilder.DropColumn(
                name: "IsNeedCharging",
                table: "TMaterials");

            migrationBuilder.DropColumn(
                name: "MaterialCategoryName",
                table: "TMaterials");

            migrationBuilder.DropColumn(
                name: "Code",
                table: "TMaterialCategories");

            migrationBuilder.DropColumn(
                name: "DisplayOrder",
                table: "TMaterialCategories");

            migrationBuilder.DropColumn(
                name: "ParentId",
                table: "TMaterialCategories");

            migrationBuilder.DropColumn(
                name: "Price",
                table: "TInventoryDetails");

            migrationBuilder.DropColumn(
                name: "TotalPrice",
                table: "TInventoryDetails");

            migrationBuilder.DropColumn(
                name: "BatchNoExplain",
                table: "TInventories");

            migrationBuilder.DropColumn(
                name: "CreateUserId",
                table: "TInventories");

            migrationBuilder.DropColumn(
                name: "CreateUserName",
                table: "TInventories");

            migrationBuilder.DropColumn(
                name: "MaterialCategoryId",
                table: "TInventories");

            migrationBuilder.DropColumn(
                name: "MaterialCategoryName",
                table: "TInventories");

            migrationBuilder.DropColumn(
                name: "ParentPalletBarcode",
                table: "TInventories");

            migrationBuilder.DropColumn(
                name: "Price",
                table: "TInventories");

            migrationBuilder.DropColumn(
                name: "TotalPrice",
                table: "TInventories");

            migrationBuilder.DropColumn(
                name: "CreateUserId",
                table: "TInterfaceLogs");

            migrationBuilder.DropColumn(
                name: "CreateUserName",
                table: "TInterfaceLogs");

            migrationBuilder.DropColumn(
                name: "CreateUserId",
                table: "TInstructs");

            migrationBuilder.DropColumn(
                name: "CreateUserName",
                table: "TInstructs");

            migrationBuilder.DropColumn(
                name: "LogicalCellAddr",
                table: "TInstructs");
        }
    }
}
